import axios from "axios";
const baseURL = "http://localhost:8888/api/private/v1/";
axios.defaults.baseURL = baseURL;
// 添加拦截器
// Add a request interceptor
axios.interceptors.request.use(function (config) {
    // Do something before request is sent
    let token = localStorage.getItem("mytoken");
    if (token) {
        // 说明登录过了
        config.headers["Authorization"]=token
        
    }
    return config;
}, function (error) {
    // Do something with request error
    return Promise.reject(error);
});
// login登录
export const checkUser = params=> {
    return axios.post("login",params).then(res=>res.data)
}
// 请求列表
export const getusers = params => {
    return axios.get("users", params).then(res => res.data)
}
